/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2024-11-15
 * Time: 16:39
 */
public class Main {
    public int search(int[] nums, int target){
        int left=0;
        int right=nums.length;
        return searchchild(nums,target,left,right);
    }

    public int searchchild(int[] nums, int target,int left,int right) {
        //折半查找
        if(left==right) return -1;
        int mid=(left+right)/2;
        if(nums[mid/2]==target) return mid;
        if(nums[mid/2]>target) return searchchild(nums,target,left,mid-1);
        if(nums[mid/2]<target) return searchchild(nums,target,mid+1,right);
        return -1;
    }
    public static void main(String[] args) {


    }
}